namespace CSharpPro._1106;

using System.Collections.Generic;

/// <summary>
/// 用户服务接口（定义业务契约）
/// </summary>
public interface IUserService
{
    /// <summary>
    /// 显示主菜单并控制流程
    /// </summary>
    void ShowMainMenu();

    /// <summary>
    /// 用户注册
    /// </summary>
    /// <returns>注册是否成功</returns>
    bool Register();

    /// <summary>
    /// 用户登录
    /// </summary>
    /// <returns>登录是否成功</returns>
    bool Login();

    /// <summary>
    /// 验证用户名格式
    /// </summary>
    /// <param name="username">待验证的用户名</param>
    /// <returns>格式是否有效</returns>
    bool IsValidUsername(string username);

    /// <summary>
    /// 验证密码格式
    /// </summary>
    /// <param name="password">待验证的密码</param>
    /// <returns>格式是否有效</returns>
    bool IsValidPassword(string password);

    /// <summary>
    /// 检查用户名是否已存在
    /// </summary>
    /// <param name="username">用户名</param>
    /// <returns>是否存在</returns>
    bool IsUsernameExists(string username);
}